<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix='sec' uri='http://www.springframework.org/security/tags'%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript" src="scripts/boot.js"></script>
</head>
<body style="border: 0px; margin: 0px; padding: 0px;width: 100%;height: 100%">
<div class="mini-toolbar" style="border-bottom:0;padding:0px;">
    <table style="width:100%;">
        <tr>
            <td style="width:100%;">
            <sec:authorize url='/exports_sta_info.do'>
                <a class="mini-button" iconCls="icon-download" onclick="exports()">导出已选</a>
                <a class="mini-button" iconCls="icon-download" onclick="exportsAll()">导出所有</a>
            </sec:authorize>
            </td>
            <td style="white-space:nowrap;">
                                           下单开始时间：<input name="startTime"  class="mini-datepicker" style="width: 180px" showClearButton="false" allowInput="false"/>
                                           下单结束时间：<input name="endTime" class="mini-datepicker" showClearButton="false" style="width: 180px" allowInput="false"/>   
                <a class="mini-button" onclick="search()">查询</a>
            </td>
        </tr>
    </table>        
</div>
<div class="mini-fit" >
	<div id="datagrid0921" class="mini-datagrid " idField="id" pageSize="20" allowAlternating="true"
		allowCellSelect="true" multiSelect="true" url="order_inquiry_sta_view.do" style="width:100%;height: 100%">
		<div property="columns">
			<div type="indexcolumn"></div>
			<div type="checkcolumn"></div>
			<div field="cusSerName" width="20%" headerAlign="center" align="center">客服代表</div>
			<div field="totalMoney" width="20%" headerAlign="center" align="center">总金额</div>
			<div field="payment" width="20%" headerAlign="center" align="center">贷款金额</div>
			<div field="freight" width="20%" headerAlign="center" align="center">运费金额</div>
			<div field="countOrderNum" width="20%" headerAlign="center" align="center">订单数量</div>
		</div>
	</div>
</div>
<script type="text/javascript">
mini.parse();
var grid = mini.get("datagrid0921");
grid.load();

function search() {
	var startTime = mini.getbyName("startTime").getFormValue();
	var endTime = mini.getbyName("endTime").getFormValue();
	grid.load({startTime: startTime, endTime: endTime});
}

function exports() {
	var rows = grid.getSelecteds();
    if (rows.length > 0) {
       var ids = [];
       for (var i = 0, l = rows.length; i < l; i++) {
           var r = rows[i];
           ids.push(r.id);
       }
       var id = ids.join(',');
       location.href = "exports_sta_info.do?id="+id;
    } else {
       mini.alert("请选中一条记录");
    }
}

function exportsAll() {
	location.href = "exports_all_sta_info.do";
}
</script>
</body>
</html>